package com.pro.framework.api.enums;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Schema(description = "重量单位")
@Getter
@AllArgsConstructor
public enum EnumWeightUnit implements IEnumStr, IEnumWeightUnit {

    MG("毫克", "mg", 1),
    G("克", "g", 1000),
    KG("千克", "kg", 1_000_000),
    TON("吨", "t", 1_000_000_000),
    LB("磅", "lb", 453_592),
    OZ("盎司", "oz", 28_349.5),

    ;
    private final String label;

    @Schema(description = "单位符号")
    private final String symbol;

    @Schema(description = "该单位等于多少毫克")
    private final double inMilligrams;

    @Override
    public EnumWeightUnit getUnit() {
        return this;
    }

    @Override
    public Integer getDecimalSize() {
        return 3;
    }
}
